|
|
|
| of the image controls. You then need to invoke the Drag method on the list box by passing the constant vbBeginDrag to signify that the list box is to go into drag mode. Now you need to write the code that will change the DragIcon property of the list box to a hand dropping a piece of paper when the user is over the image control that matches the item in the list box. Youll write this code in the DragOver() event of each of the ImageList controls. |
|
|
| Change the DragIcon as You Move Around the Form 1. Double-click the imaArrow image control. 2. Select the DragOver event from the Procedures combo box. 3. Add the following code to the DragOver event: | | Sub imaArrow_DragOver (Source As Control, X As Single, _
Y As Single, State As Integer)
If TypeOf Source Is ListBox Then
If Source.Text = imaArrow.Tag Then
If State = vbEnter Then
Source.DragIcon = LoadPicture("drop1pg.ico")
ElseIf State = vbLeave Then
Source.DragIcon = LoadPicture("Folder05.ico")
End If
End If
End If
End Sub |  | In this event, you first check to make sure that the source control being dragged over the image control is a list box. Remember that the user might be dragging the other image controls around, and you dont want to change the icon if you dont have to. Next, you compare the Text property of the list box control to see whether it matches the value in the imaArrow Tag property. You then use code very similar to what you did before for the no drop text box. |
|
|
|